From fe56015cb1d8aad9c863d9a017f12ad7e374f132 Mon Sep 17 00:00:00 2001 From: justbur Date: Thu, 31 Mar 2016 16:13:06 -0400 Subject: [PATCH] Fix key-chord problem See the note in which-key--update --- which-key.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/which-key.el b/which-key.el index 2706a99062b..8435d2eb2ec 100644 --- a/which-key.el +++ b/which-key.el @@ -2028,8 +2028,13 @@ Finally, show the buffer." (condition-case nil (let ((rkeys (recent-keys))) (vector 'key-chord - (aref rkeys (- (length rkeys) 2)) - (aref rkeys (- (length rkeys) 1)))) + ;; Take the two preceding the last one, because the + ;; read-event call in key-chord seems to add a + ;; spurious key press to this list. Note this is + ;; different from guide-key's method which didn't work + ;; for me. + (aref rkeys (- (length rkeys) 3)) + (aref rkeys (- (length rkeys) 2)))) (error (progn (message "which-key error in key-chord handling") [key-chord]))))) -- 2.30.2